const KoaRouter = require('@koa/router')
const { sign,test } = require('../controller/login.controller')
const {verifyLogin,verifyAuth} = require('../middleware/login.middleware')

const loginRouter = new KoaRouter({ prefix: '/login' })
// loginRouter.post("/",(ctx,next)=>{
//     const {name,password}=ctx.request.body
// console.log(name,password)
// 1 判断用户是否为空

//2 判断用户是否存在

//3 判断用户名和密码是否匹配

//4传递token
// }}
loginRouter.post('/', verifyLogin, sign)
loginRouter.get("/test",verifyAuth,test) 

module.exports = loginRouter
